<?php
/**
 * Klasa loga
 *
 */
class MfSqliteLog  extends DataObject {

	/**
	 * nazwa tabeli
	 */
	static $tableName = 'mf_log';

	/**
	 * nazwa klucza tabeli
	 */
	static $classTablePK = 'id_mf_log';
		
	/**
	 * nazwa klasy
	 */
	static $className = __CLASS__;

	/**
	 * tabela mapująca pola z bazy SQL na pola klasy.
	 */
	static $fields = array(
		'id_mf_log' =>'id',
		'type' =>'type',
		'description' =>'message',
		'time'	=>'time'
	);

	protected $id;
	private $type;
	private $message;
	private $time;

	public function GetId() {
		return $this->id;
	}

	public function SetId($id) {
		$this->id = $id;
	}

	public function GetType() {
		return $this->type;
	}

	public function SetType($type) {
		$this->type = $type;
	}

	public function GetMessage() {
		return $this->message;
	}

	public function SetMessage($message) {
		$this->message = $message;
	}


	public function GetTime() {

		if($this->time == '') {
			$this->SetTime(date("Y-m-d G:i:s"));
		}

		return $this->time;
	}

	public function SetTime($time) {
		$this->time = $time;
	}






	public function __construct($id = -1) {
		$this->SetId($id);
	}

	 /**
	 * Pobiera nazwę tabeli reprezentującej obiekt w SQL
	 * @return string
	 */

	public  function GetTableName(){
		return self::$tableName;
      }
	/**
       * Pobiera taablice mapującą pola klasy na pola tabeli
       * @return array
       */
	public  function GetFields(){
		return self::$fields;
      }
	/**
       * Pobiera nazwę klasy
       * @return string
       */
	public  function GetClassName(){
		return self::$className;
      }


    public function GetClassTablePK() {
        return self::$classTablePK;
    }
}
?>